package org.example.mybatis.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.example.mybatis.model.UserInfo;

import java.util.List;
@Mapper
public interface AssignmentMapper {
    @Select("select * from userinfo where id= #{id}")
    List<UserInfo> selectId(Integer id);

    @Select("select * from userinfo where id= ${id}")
    List<UserInfo> selectId1(Integer id);
    @Select("select * from userinfo where username = #{name}")
    List<UserInfo> selectId2(String name);
    @Select("select * from userinfo where username = '${name}'")
    List<UserInfo> selectId3(String name);
    @Select("select * from userinfo where username = '${name}'")
    List<UserInfo> selectId4(String name);
    @Select("select * from userinfo order by id #{sort}")
    List<UserInfo> selectId5(String sort);
    @Select("select * from userinfo order by id ${sort}")
    List<UserInfo> selectId6(String sort);
    @Select("select * from userinfo where username = like concat('%',#{key},'%') ")
    List<UserInfo> selectId7(String key);
}
